<h1>Torrents For All Users</h1>

<table id="torrent_list">
  <tr>
		<th>ID</th>
    <th>Torrent Name</th>
		<th>User ID</th>
  </tr>

<% for torrent in @torrents %>
	<% for u in @t_status[torrent.id.to_s][:users] %>
		<tr>
			<td><%=h torrent.id %></td>
		  <td><%=h torrent.name %></td>
			<td><%=h u.id %></td>
			<td> <%= button_to 'delete', {:controller => 'torrent', :action => 'destroy', :id => torrent.id, :uid => u.id}, :method => :delete %></td>
			<td>		
			<% if(@t_status[torrent.id.to_s] == 100)%>
				<%= link_to 'retrieve', :controller => 'admin', :action => 'retrieve_torrent', :id => torrent.id %>
			<% end %>	
			</td>	
			<td>Percent Done: <%= progress_bar("progress" + torrent.id.to_s, @t_status[torrent.id.to_s][:percent_done] / 100.0, true, true) %></td>
		</tr>
  <% end %>
<% end %>
</table>
